<nz-row>
  <div class="searchItem">
    <label for="serialQuery">编码：</label>
    <input id="serialQuery" nz-input placeholder="编码/序列号" [(ngModel)]="query.code"/>
  </div>
  <div class="searchItem">
    <label for="brandQuery">设备品牌：</label>
    <nz-select id="brandQuery" [(ngModel)]="query.typeId" nzPlaceHolder="全部" nzMode="multiple" [nzBackdrop]="true" (ngModelChange)="getTypeList()" [nzMaxTagCount]="1" nzAllowClear
               nzShowSearch>
      <nz-option [nzValue]="brand.id" [nzLabel]="brand.name" *ngFor="let brand of brandOptions"></nz-option>
    </nz-select>
  </div>
  <div class="searchItem">
    <label for="typeQuery">设备型号：</label>
    <nz-select id="typeQuery" [(ngModel)]="query.modelId" nzPlaceHolder="全部" nzMode="multiple" [nzBackdrop]="true" [nzMaxTagCount]="1" nzAllowClear
               nzShowSearch>
      <nz-option [nzValue]="type.id" [nzLabel]="type.name" *ngFor="let type of typeOptions"></nz-option>
    </nz-select>
  </div>
  <div class="searchItem">
    <label for="locationQuery">库位：</label>
    <nz-select id="locationQuery" [(ngModel)]="query.libraryId" nzPlaceHolder="全部" nzMode="multiple" [nzBackdrop]="true"
               [nzMaxTagCount]="1" nzAllowClear
               nzShowSearch>
      <nz-option [nzValue]="location.id" [nzLabel]="location.name" *ngFor="let location of locationOptions"></nz-option>
    </nz-select>
  </div>
  <div class="searchItem">
    <label for="finishedQuery">成交入库时间：</label>
    <nz-range-picker id="finishedQuery" nzFormat="yyyy-MM-dd" [(ngModel)]="query.finished"></nz-range-picker>
  </div>
  <div class="searchItem">
    <button nz-button nzType="primary" (click)="queryBtn()">查询</button>
    <button nz-button nzType="default" (click)="resetQuery()">重置</button>
  </div>
</nz-row>
<!--操作-->
<nz-row>
  <button nz-button nzType="primary" (click)="save()">使用已勾选</button>
</nz-row>
<!--表格-->
<nz-table
  style="margin-top: 8px"
  #rowSelectionTable
  nzSize="small"
  nzShowSizeChanger
  nzShowQuickJumper
  nzOuterBordered
  [nzScroll]="{y: '640px' }"
  [nzData]="listOfData.records"
  [nzPageSizeOptions]="[5, 10, 20, 50, 500]"
  [nzTotal]="listOfData.total"
  [(nzPageIndex)]="query.page"
  [(nzPageSize)]="query.pageSize"
  [nzFrontPagination]="false"
  [nzShowTotal]="totalTemplate"
  (nzPageIndexChange)="onPageIndexChange($event)"
  (nzPageSizeChange)="onPageSizeChange($event)"
>
  <thead>
  <tr>
    <th [nzChecked]="checked" [nzIndeterminate]="indeterminate" (nzCheckedChange)="onAllChecked($event)"></th>
    <th nzAlign="center">机器编码</th>
    <th nzAlign="center">库位</th>
    <th nzAlign="center">回收价</th>
    <th nzAlign="center">成色</th>
    <th nzAlign="center">型号</th>
    <th nzAlign="center">首次入库时间</th>
    <th nzAlign="center">成交入库时间</th>
  </tr>
  </thead>
  <tbody>
  <tr *ngFor="let data of rowSelectionTable.data;let index=index;">
    <td
      [nzChecked]="setOfCheckedId.has(data.equipmentCode)"
      [nzDisabled]="data.disabled"
      (nzCheckedChange)="onItemChecked(data.equipmentCode, $event)"
    ></td>
    <td nzAlign="center">{{ data['equipmentCode'] }}</td>
    <td nzAlign="center">{{ data['libraryName'] }}</td>
    <td nzAlign="center">{{ (data['realValuation'] || 0) + (data['aprc'] || 0) + (data['cprc'] || 0) }}</td>
    <td nzAlign="center">{{ data['colourName'] }}</td>
    <td nzAlign="center">{{ data['modelName'] }}</td>
    <td nzAlign="center">{{ data['createTime'] }}</td>
    <td nzAlign="center">{{ data['clinchTime'] }}</td>
  </tr>
  </tbody>
</nz-table>
<ng-template #totalTemplate let-total>共有 {{ listOfData.total }} 条</ng-template>
